<?php 
namespace app\dboard\logic;
use think\Db;
use think\facade\Session;
class Appointment extends Base
{

	function __construct()
	{
	}

	public function edit($param)
	{
		$name = isset($param['name']) ? trim($param['name']):'';
		$contacts = isset($param['contacts']) ? trim($param['contacts']):'';
		$phone = isset($param['phone']) ? trim($param['phone']):'';
		$province = isset($param['province']) ? trim($param['province']):'';
		$city = isset($param['city']) ? trim($param['city']):'';
		$area = isset($param['area']) ? trim($param['area']):'';
		$address = isset($param['address']) ? trim($param['address']):'';
		$description = isset($param['description']) ? trim($param['description']):'';
		$sid = isset($param['sid']) ? intval($param['sid']):0;
		$store= Db::name('store')->where([['id','=',$sid]])->find();
		if (!$store) {
			$this->res_data['Msg'] = "无此门店";
			return $this->res_data;
		}
		$data['updatetime'] =time();
    $sdata = Db::name('store')->where([['id','=',$sid]])->data($data)->update();
    if(!$sdata) {
        $this->res_data['Msg'] = '编辑失败';
        return $this->res_data;
    }
    $this->res_data['Msg'] = '成功';
    $this->res_data['Code'] = 0;
    return $this->printResult($this->res_data);
	}
}

?>
